

OBJ=obj
SRC=src
EXE=bin
CPPFLAGS=-c -g -O0
CXX=g++

SRCFILES=
OBJFILES=$(OBJ)/utilities.o \
		 $(OBJ)/matrixUtilities.o \
		 $(OBJ)/findSubString.o \
         $(OBJ)/maxSubArray.o \
         $(OBJ)/incrSubArray.o

all: 	testUtilities.exe \
        testMatrix.exe \
        testFindMinWindow.exe \
        testMaxSubArray.exe \
        testIncrSubArray.exe \
        install

testUtilities.exe : $(OBJ)/testUtilities.o $(OBJFILES)
	$(CXX) -o $@ $^

testMatrix.exe : $(OBJ)/testMatrix.o $(OBJFILES)
	$(CXX) -o $@ $^

testFindMinWindow.exe : $(OBJ)/testFindMinWind.o $(OBJFILES)
	$(CXX) -o $@ $^

testMaxSubArray.exe : $(OBJ)/testMaxSubArray.o $(OBJFILES)
	$(CXX) -o $@ $^

testIncrSubArray.exe : $(OBJ)/testIncrSubArray.o $(OBJFILES)
	$(CXX) -o $@ $^

$(OBJ)/%.o : $(SRC)/%.cpp
	$(CXX) $(CPPFLAGS) -o $@ $<

install:
	mv *.exe $(EXE)/.

clean:
	rm -rf 	$(OBJ)/*.o $(EXE)/*.exe
